package com.greatwqs.wmall.product.client.service;

import com.greatwqs.wmall.common.module.exception.AppException;
import com.greatwqs.wmall.product.client.model.ProductResponse;
import com.greatwqs.wmall.product.client.model.ProductSubStockRequest;

import java.util.List;
import java.util.Map;

/**
 * @author wang-qingsong
 */
public interface ProductClientService {

    ProductResponse getProductById(Long productId);

    List<ProductResponse> getProductListByIds(List<Long> productIds);

    Map<Long, ProductResponse> getProductMapByIds(List<Long> productIds);

    /**
     * 扣库存
     */
    void subProductStock(ProductSubStockRequest request) throws AppException;

    void subProductStock(List<ProductSubStockRequest> requests) throws AppException;
}